<?php
/**
 * Description
 *
 * PHP version 7
 *
 * @category Custom
 * @package  Custom
 * @author   ryu <mo5467@126.com>
 * @date     2020-04-22 23:51:11
 * @lastTime 2020-05-01 23:20:05
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     none
 */

namespace Design\Creational\Builder;

use Design\Creational\Builder\Parts\Car;
use Design\Creational\Builder\Parts\Door;
use Design\Creational\Builder\Parts\Wheel;
use Design\Creational\Builder\Parts\Engine;
use Design\Creational\Builder\Parts\Vehicle;

class CarBuilder implements Builder
{

    private $car;


    public function createVehicle()
    {
        $this->car = new Car();

    }//end createVehicle()


    public function addDoors()
    {
        $this->car->setPart('leftDoor', new Door());
        $this->car->setPart('rightDoor', new Door());
        $this->car->setPart('trunkLid', new Door());

    }//end addDoors()


    public function addEngine()
    {
        $this->car->setPart('engine', new Engine());

    }//end addEngine()


    public function addWheel()
    {
        $this->car->setPart('wheelLF', new Wheel());
        $this->car->setPart('wheelRF', new Wheel());
        $this->car->setPart('wheelLR', new Wheel());
        $this->car->setPart('wheelRR', new Wheel());

    }//end addWheel()


    public function getVehicle()
    {
        return $this->car;

    }//end getVehicle()


}//end class
